package com.zr.controller;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.zr.service.UserService;
/**
 * 用户信息删除的servlet
 * @author Administrator
 *
 */
public class DelUserController extends HttpServlet {
	 UserService userservice = new UserService();
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
	// TODO Auto-generated method stub
	doPost(req, resp);
}
@Override
	protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		// TODO Auto-generated method stub
	//接受页面传来的删除的值
	String userIds[] = req.getParameterValues("uids");
	resp.setCharacterEncoding("utf8");
	//调取对应的服务
		int result = userservice.delAdminByaids(userIds);
	//拿到这只笔
	PrintWriter pw = resp.getWriter();
	//把结果写回去
	pw.write(String.valueOf(result));
	}
}
